<template>
	<!--修改界面-->
	<el-dialog v-loading.fullscreen.lock="loading" element-loading-text="处理中......" title="修改险类" :visible.sync="dialogVisible" size="small" :close-on-click-modal="false" :close-on-press-escape="false" :before-close="off" :top="dialog_margin_top">
		  <el-form label-width="150px" >
		  <el-row :span="24">
		  	<el-col :span="24">
          <el-form-item label="分/支公司代码">
            <el-input v-model="formData.comcode" size="small" disabled></el-input>
          </el-form-item>
          <el-form-item label="险种代码">
            <el-input v-model="formData.riskcode" size="small" disabled></el-input>
          </el-form-item>
          <el-form-item label="代理人代码">
            <el-input v-model="formData.agentcode" size="small" disabled></el-input>
          </el-form-item>
          <el-form-item label="是否见费出单">
            <el-select v-model="formData.ispolicypay" placeholder="是否见费出单" size="small">
              <el-option v-for="item in policypayOptions" :key="item.value" :label="item.value + '-'+ item.label" :value="item.value"></el-option>
            </el-select>
          </el-form-item>
		  	</el-col>
		  </el-row>
		</el-form>
		  <span slot="footer" class="dialog-footer">
			   <el-button @click="off">取 消</el-button>
			   <el-button type="warning" @click="edit">保存</el-button>
		  </span>
	</el-dialog>
</template>

<script>
  import PolicyPayAPI from "../../../../js/production/policypay/policyPayAPI"
  export default {
    data() {
      return {
        dialog_margin_top: '5%',
        dialogVisible: true,
        formData: {
          comcode: '',
          riskcode: '',
          agentcode: '',
          ispolicypay: '',
        },
        policypayOptions: [
          {label: '是', value: 'Y'},
          {label: '否', value: 'N'}
        ],
        loading: false,
      }
    },
    mounted() {
      this.formData = Object.assign({}, this.$parent.selectedRows[0]);
    },
    methods: {
      edit() {
        PolicyPayAPI.edit(this);
      },
      off() {
        this.$parent.showEditDialog = false;
      },
    }
  }
</script>
